/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dk.rofl.items;

import rofl.Utils;

/**
 *
 * @author menderleit
 */
public class HealthPotion extends GameItem {

    private int count;

    // Constructor
    public HealthPotion(int itemLevel) {
        super(TYPE_POTION, "Health Potion", itemLevel);
        count = 1;
    }

    public void addPotion() {
        count++;
    }
    
    // Get health points from this potion.
    public int getHealth() {
        int hp = 0;
        if (count > 0) {
            int base = getItemLevel() * 25;
            hp = base + Utils.rnd().nextInt(base / 2 + 1);
            count--;
        }
        return hp;
    }

    public int getMinimum() {
        int base = getItemLevel() * 25;
        return base;
    }

    public int getMaximum() {
        int base = getItemLevel() * 25;
        int max = base + (base / 2);
        return max;
    }

    public String getHealingString() {
        return "(" + getMinimum() + " - " + getMaximum() + ")" + " x " + getNumPotions();
    }
    
    // Has this potion been used?
    public int getNumPotions() {
        return count;
    }
}
